﻿

CREATE PROCEDURE [dbo].[proc_Project_CreateNewTask]
(
	@FId uniqueidentifier,
	@OrderId uniqueidentifier,
	@ProjectId uniqueidentifier,
	@ProjectName nvarchar(50),
	@ProductId int,
	@CusName nvarchar(50),
	@Title nvarchar(50),
	@WebType smallint,
	@Description nvarchar(2000),
	@DownPerson nvarchar(50),
	@DownPersonName nvarchar(50),
	@ExecDepartmentId int,
	@ExecDepartmentName nvarchar(50),
	@ExecPerson nvarchar(50),
	@ExecPersonName nvarchar(50),
	@StartDate datetime,
	@IsFinish bit,
	@CreateDate datetime,
	@CompanyId int,
	@TypeId int
)
AS
Begin
	Insert Into Project_Task
	(
		FId,OrderId,ProjectId,ProjectName,ProductId,CusName,Title,WebType,Description,
		DownPerson,DownPersonName,ExecDepartmentId,ExecDepartmentName,ExecPerson,
		ExecPersonName,StartDate,IsFinish,CreateDate,CompanyId,TypeId
	)
	Values
	(
		@FId,@OrderId,@ProjectId,@ProjectName,@ProductId,@CusName,@Title,@WebType,@Description
		,@DownPerson,@DownPersonName,@ExecDepartmentId,@ExecDepartmentName,@ExecPerson
		,@ExecPersonName,@StartDate,@IsFinish,@CreateDate,@CompanyId,@TypeId
	)
	--改变订单状态(当成单状态是项目分析完成时)
	Update [Order] Set StateId=4 Where OId=@OrderId And StateId=3
End